package com.leyou.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.leyou.common.utils.JsonUtils;
import com.leyou.dto.SpecParamDTO;
import com.leyou.dto.SpuDetailDTO;
import com.leyou.entity.Spu;
import com.leyou.entity.SpuDetail;
import com.leyou.mapper.SpuDetailMapper;
import com.leyou.mapper.SpuMapper;
import com.leyou.service.SpecParamService;
import com.leyou.service.SpuDetailService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

@Service
public class SpuDetailServiceImpl extends ServiceImpl<SpuDetailMapper, SpuDetail> implements SpuDetailService {

    @Autowired
    private final SpuMapper spuMapper;
    @Autowired
    private final SpecParamService specParamService;

    public SpuDetailServiceImpl(SpuMapper spuMapper, SpecParamService specParamService) {
        this.spuMapper = spuMapper;
        this.specParamService = specParamService;
    }


    //todo 根据id查询SpuDetail(商品详情)
    @Override
    public SpuDetailDTO querySpuDetailById(Long id) {
        return new SpuDetailDTO(this.getById(id));
    }

}
